package com.ruoyi.web.controller.teaching;


import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.teaching.domain.PlatformUVirtualStudy;
import com.ruoyi.teaching.service.PlatformUVirtualStudyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王旭
 * @since 2024-07-25
 */
@RestController
@RequestMapping("/platform/virtualStudy")
@Api(tags = "platform-虚拟仿真考核管理")
@Validated
public class PlatformUVirtualStudyController {
    @Autowired
    private PlatformUVirtualStudyService platformUVirtualStudyService;

    /**
     * 查询自己某一虚拟仿真下的所有考核
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询自己某一虚拟仿真下的所有考核",notes = "查询自己某一虚拟仿真下的所有考核")
    public AjaxResult list(Long virtualId) {
        return platformUVirtualStudyService.selectPlatformUVirtualStudyList(virtualId);
    }

    /**
     * 新增虚拟仿真考核
     */
    @Log(title = "【新增虚拟仿真考核】", businessType = BusinessType.INSERT)
    @ApiOperation(value = "新增虚拟仿真考核",notes = "新增虚拟仿真考核")
    @PostMapping
    public AjaxResult add(@Valid @RequestBody PlatformUVirtualStudy platformUVirtualStudy) {
        return platformUVirtualStudyService.insertPlatformUVirtualStudy(platformUVirtualStudy);
    }

}

